vtpmmgr: Shutdown more gracefully
authorJason Andryuk <jandryuk@gmail.com>
Thu, 6 May 2021 13:59:18 +0000 (09:59 -0400)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 10 May 2021 13:49:01 +0000 (14:49 +0100)
commit1b4bfa0b8f6a47c2b80bdc203bb0487fe1bd4366
tree1cdc9755b162014c18f93e662fdcea5e68f2cb4f
parent746d20b112ace151b19f06bd5e1fb3d695d8982e
vtpmmgr: Shutdown more gracefully

vtpmmgr uses the default, weak app_shutdown, which immediately calls the
shutdown hypercall.  This short circuits the vtpmmgr clean up logic.  We
need to perform the clean up to actually Flush our key out of the tpm.

Setting do_shutdown is one step in that direction, but vtpmmgr will most
likely be waiting in tpmback_req_any.  We need to call shutdown_tpmback
to cancel the wait inside tpmback and perform the shutdown.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibaut@ens-lyon.org>
Reviewed-by: Daniel P. Smith <dpsmith@apertussolutions.com>
stubdom/vtpmmgr/vtpmmgr.c